<template>
	<view>
		<view :style="{ height: statusBarHeight  +navBarHeight + 'px','position':title?'':'absolute',background:title?'white':'transparent'}"  style="display: flex;z-index: 99;width: 100%;">
			<view class="" style="display: flex;justify-content: center;align-items: center;width: 100%;" >
					<view @click="toPath" class="" style="position: absolute;left: 10rpx;" >
						<u-icon name="arrow-left" size="20"></u-icon>
					</view>
					<text style="font-size: 30rpx;font-weight: bold;">{{title}}</text>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		props:{
			title: {
				type: Number | String,
				default: ''
			},
			type:{
				type: Number | String,
				default: 'navigateBack'
			},
			path:{
				type: Number | String,
				default: '/pages/tabbar/index'
			}
		},
		data() {
			return {
				statusBarHeight:this.$store.state.statusBarHeight,
				navBarHeight:this.$store.state.navBarHeight,
			}
		  },
		methods: {
			toPath(){
				if(this.navigateBack == 'navigateBack')
					uni.navigateBack()
				else if(this.navigateBack == 'navigateTo'){
					uni.navigateTo({
						url:this.path
					})
				}
				else{
					uni.reLaunch({
						url:this.path
					})
				}
			}
		}
	}
	</script>
</script>

<style>
</style>